package com.ltmonitor.jt808.protocol;

public class PostitionAdditional_RouteDriveTimeAlarmAdditional implements
		IPositionAdditionalItem {

	public final int getAdditionalId() {
		return 0x13;
	}

	public final byte getAdditionalLength() {
		return 0x07;
	}

	/**
	 * 路段ID
	 */

	private int routeId;

	public final int getRouteId() {
		return routeId;
	}

	public final void setRouteId(int value) {
		routeId = value;
	}

	/**
	 * 行驶时间,单位为秒(s)
	 */
	private short driveTime;

	public final short getDriveTime() {
		return driveTime;
	}

	public final void setDriveTime(short value) {
		driveTime = value;
	}

	/**
	 * 结果,0: 不足,1:过长
	 */
	private byte result;

	public final byte getResult() {
		return result;
	}

	public final void setResult(byte value) {
		result = value;
	}

	public final byte[] WriteToBytes() {
		try {
			MyBuffer buff = new MyBuffer();
			try {
				buff.put(getRouteId());
				buff.put(getDriveTime());
				buff.put(getResult());
			} finally {

			}
			return buff.array();
		} finally {

		}
	}

	public final void ReadFromBytes(byte[] bytes) {

		try {
			MyBuffer buff = new MyBuffer(bytes);
			try {
				setRouteId(buff.getInt());
				setDriveTime(buff.getShort());
				setResult(buff.get());
			} finally {

			}
		} finally {

		}
	}
}